<!--
* @Description: 用户操作日志 - 表单
* @Author:
* @Date: 2022-03-11 23:12:12
 * @LastEditors: DHL
 * @LastEditTime: 2022-06-15 10:04:51
-->
<template>
  <tw-dialog
    v-model="visible"
    :title="title"
    :loading="loading"
    width="800px"
    height="600px"
    @close="handleClose"
  >
    <el-form ref="dbFormRef" :model="dbForm" :rules="rules" label-width="90px">
      <el-form-item label="姓名" prop="userName">
        <!--<el-input v-model="dbForm.userName" clearable placeholder="请输姓名"></el-input>-->
        {{ dbForm.userName }}-{{ dbForm.userLoginName }}
      </el-form-item>

      <el-form-item label="发生时间" prop="resourceNo">
        <!--<el-input v-model="dbForm.resourceNo" clearable placeholder="请输业务编号"></el-input>-->
        {{ dbForm.createDate }}
      </el-form-item>
      <el-form-item label="业务编号" prop="resourceNo">
        <!--<el-input v-model="dbForm.resourceNo" clearable placeholder="请输业务编号"></el-input>-->
        {{ dbForm.resourceNo }}
      </el-form-item>

      <el-form-item label="用户访问地址" prop="url">
        <!--<el-input v-model="dbForm.url" clearable placeholder="请输用户访问地址"></el-input>-->
        {{ dbForm.url }}
      </el-form-item>

      <el-form-item label="操作内容" prop="logContent">
        <!--<el-input v-model="dbForm.logContent" clearable placeholder="请输操作内容"></el-input>-->
        {{ dbForm.logContent }}
      </el-form-item>

      <el-form-item label="提交参数" prop="param">
        <!--<el-input v-model="dbForm.param" clearable placeholder="请输提交参数"></el-input>-->
        <el-alert
          :description="dbForm.param"
          type="warning"
          left
          :closable="false"
          style="word-break: break-all"
        >
        </el-alert>
      </el-form-item>

      <el-form-item label="操作结果" prop="logResult">
        <!--<el-input v-model="dbForm.logResult" clearable placeholder="请输操作结果"></el-input>-->
        <el-alert
          v-if="dbForm.logResult == '1'"
          :title="dbForm.logResultText"
          type="success"
          left
          show-icon
          :closable="false"
        >
        </el-alert>
        <el-alert
          v-if="dbForm.logResult == '0'"
          :title="dbForm.logResultText"
          type="error"
          left
          show-icon
          :closable="false"
        >
        </el-alert>
      </el-form-item>

      <el-form-item label="异常信息" prop="exceptionInfo">
        <!--<el-input v-model="dbForm.exceptionInfo" clearable placeholder="请输异常信息"></el-input>-->
        <el-alert
          :title="dbForm.exceptionInfo"
          type="error"
          left
          :closable="false"
          style="word-break: break-all"
        >
        </el-alert>
      </el-form-item>

      <el-form-item label="主机IP" prop="ip">
        <!--<el-input v-model="dbForm.ip" clearable placeholder="请输主机IP"></el-input>-->
        <strong>{{ dbForm.ip }}</strong>
      </el-form-item>

      <el-form-item label="耗时" prop="costTime">
        <!--<el-input-number v-model="dbForm.costTime" clearable placeholder="请输耗时" />-->
        <strong>{{ dbForm.costTime }}</strong>
      </el-form-item>

      <el-form-item label="备注" prop="remark">
        <!--<el-input v-model="dbForm.remark" clearable placeholder="请输备注"></el-input>-->
        {{ dbForm.remark }}
      </el-form-item>
    </el-form>

    <template #footer>
      <el-button @click="handleReset(true)">取 消</el-button>
      <el-button v-if="action === 'add'" type="warning" @click="handleSubmit(true)">
        提交并继续
      </el-button>
      <el-button v-if="action != 'view'" type="primary" @click="handleSubmit(false)">
        提 交
      </el-button>
    </template>
  </tw-dialog>
</template>

<script src="./useForm.ts"></script>

<style scoped lang="scss"></style>
